import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        for(int i=0;i<t;i++){
            int x=sc.nextInt();
            int y=sc.nextInt();
            int stepX= (int) Math.ceil((double)x/5);
            for(int j=4;j>=1;j--){
                if(x%j==0){
                    stepX=x/j;
                    break;
                }
            }
            int stepY= (int) Math.ceil((double)y/5);
            for(int j=4;j>=1;j--){
                if(y%j==0){
                    stepY=y/j;
                    break;
                }
            }
            System.out.println(stepX+stepY);
        }
    }
}